import ReactDOM from 'react-dom/client';
import { BrowserRouter } from 'react-router-dom';
import App from './App';
import { StyleProvider } from '@/context/style-provider';
import { invoke } from '@tauri-apps/api/core';
import {SettingsProvider} from "@/context/SettingsProvider";
import 'virtual:svg-icons-register';
import '@/styles/global.css';
import '@/styles/index.scss';
ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
    <BrowserRouter>
        <StyleProvider>
            <SettingsProvider>
                <App />
            </SettingsProvider>
        </StyleProvider>
    </BrowserRouter>,
)

document.addEventListener('DOMContentLoaded', () => {
    setTimeout(() => {
        invoke('close_splashscreen').then();
    }, 1000);
});
